FileLength XFCN returns the size of the data fork of a file in bytes.
Anyway, as you can probably guess by it's name, FileLength gets the length of any file whose name you pass to it. I needed this for a stack I'm developing that will be reading text files.
If FileLength encounters an error of some sort
(can't find the file, or the file is aready open), the result will be zero. If for some strange reason someone tries to open a non-text file, FileLength
will work, but will only return the length of the data fork. So opening a program, for example, will probably return a result of zero.
"FileLength" is absolutely FREE and was developed with the LightSpeed Pascal Compiler. Source available on request (via GEnie E-Mail or SASE):
Jeff Fischer
2246 Olivine Dr.
Carbon Canyon, CA 91709
GEnie: JFISCHER
ΓÇóΓÇóNote from Steve Drazga, Editor DevStack
I would like to publicly thank Jeff for taking the time to send his contribution to the Developer Stack.
-- part contents for background part 7
----- text -----
Syntax:
FileLength(<filePathName>)
Returns the length (in bytes) of the data fork of a file. If an error occurs it will return 0.